package com.shiminghui;

import java.util.Scanner;

public class DaFen {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int[] arr = new int[6];
        for (int i = 0; i < arr.length; i++) {
            arr[i]=scanner.nextInt();
            if (arr[i]>100||arr[i]<0){
                System.out.println("输入0-100的数,请从新输入");
                i--;
            }
        }


        int max=arr[0],min=arr[0];int result=0;
        for (int i = 1; i < arr.length; i++) {
            if (max<arr[i]){
                max=arr[i];
            }
            if (min>arr[i]){
                min = arr[i];
            }
            result+=arr[i];
        }

        System.out.println((result-max-min)/(arr.length-2));


    }
}
